<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/2/13
  Time: 17:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <%--    <link rel="stylesheet" href=<%=request.getContextPath()+"/static/css/reset.css" %> />--%>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/reset.css"/>
    <%--    <link rel="stylesheet" href=<%=request.getContextPath()+"/static/css/lr.css" %> />--%>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/lr.css"/>
</head>
<body>

<form action="${pageContext.request.contextPath}/loginServlet">
    <div class="container">
        <header>登录</header>

        <div class="rows">
            <div class="label">用户名</div>
            <div class="input"><input type="text" name="username"></div>
        </div>
        <div class="rows">
            <div class="label">密码</div>
            <div class="input"><input type="password" name="password"></div>
        </div>
        <div class="rows">
            <div class="label">验证码</div>
            <div class="yzm"><input type="text" name="checkCode"></div>
            <div class="yzm">
                <img id="img" src=<%= request.getContextPath()+"/checkCodeServlet"%> alt=""/>
            </div>
        </div>

        <div>
            <input type="submit" value="登录"/>
        </div>

        <div class="red">
            ${requestScope.checkCode_err}
        </div>
        <div class="red">
            ${requestScope.user_err}
        </div>
    </div>
</form>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"/>
<script>
    console.log(123321);
</script>
<script>
    $(function () {
        console.log($);
        $('#img').click(function () {
            console.log('click');
            $(this).attr("src", "${pageContext.request.contextPath}/checkCodeServlet?" + Date.now());
        })
    })
</script>
</html>
